# Contributor: Eric Tian <thxdaemon+gitlab.alpine@gmail.com>
# Maintainer: Eric Tian <thxdaemon+gitlab.alpine@gmail.com>
pkgname=libmarisa
pkgver=0.2.6
pkgrel=0
pkgdesc="MARISA: Matching Algorithm with Recursively Implemented StorAge"
url="https://github.com/s-yata/marisa-trie"
arch="all"
license="BSD-2-Clause OR LGPL-2.1-or-later"
makedepends="autoconf automake libtool"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/s-yata/marisa-trie/archive/v$pkgver.tar.gz"
builddir="$srcdir/marisa-trie-$pkgver"

prepare() {
	default_prepare
	autoreconf -i
}

build() {
	local configure_options=

	case "$CARCH" in
		x86_64)	configure_options="$configure_options --enable-sse2" ;;
	esac

	./configure --prefix=/usr $configure_options
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="c094e4b22e1457efdd20f2b978ee421b53e36ed94e4fdbd8944136c0ba23da4f6ba9fe3a2c64729c1426aee4dbe8098bfa5eebb943ae7fdaa4eec760485c564d  libmarisa-0.2.6.tar.gz"
